﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VolunteerHubAdapter;
using NUnit.Framework;
namespace VolunteerHubAdapter.Tests
{
    [TestFixture()]
    public class VolunteerHubHelperTests
    {
        [Test()]
        public void VolunteerHubHelperConstructorWithNullArgumentTest()
        {
            VolunteerHubHelper helper = null;

            Assert.Throws<ArgumentNullException>(delegate() { helper = new VolunteerHubHelper(null); });
        }

        [Test()]
        public void GetOrganizationTest()
        {
            string password = "";
            string url = "https://yourorg.volunteerhub.com";
            string user = "";

            Models.Settings model = new Models.Settings()
            {
                Password = password,
                URL = url,
                User = user
            };

            VolunteerHubHelper helper = new VolunteerHubHelper(model);
            Models.Organization org = null;

            Assert.DoesNotThrow(delegate() { org = helper.Organization; });
            Assert.True(org.Name == "Omatic Software");
        }
    }
}
